home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / SOUND / SOUNDCON.ZIP / !SoundCon / Docs / Formats next >
Text File  |  1995-08-31  |  13KB  |  327 lines

  1. Description of formats supported by SoundCon
  2. ============================================
  3. Rick Hudson, rick@actrix.gen.nz
  4.  
  5.  
  6. Last updated on 31 August 1995
  7.  
  8.  
  9. There are two general classes of sound sample formats, compressed and
  10. uncompressed. Uncompressed samples are described relatively simply by the
  11. number of channels, bits per sample and sample format. Compressed samples
  12. are usually more complex; these are described later.
  13.  
  14. The sub-formats of each format is not described indivually because they are
  15. simply providing you with a choice of standard sub-formats. The meanings of
  16. the items found in the sub-menus (and the raw data interpretation menu) are
  17. described here:
  18.  
  19.   - Mono and stereo are for one and two channel samples. Note that stereo
  20.     samples must be interleaved in blocks of one (ie LRLRLRLR...). Formats
  21.     like AudioWorks (which interleaves in blocks of eight) can't be
  22.     interpreted as raw data by SoundCon and has special conversion code to
  23.     deal with that. One or two channels are supported for output conversion
  24.     and playback. Up to four are supported for conversion input.
  25.  
  26.   - 8 and 16 bit is for bits per sample. This only applies to the linear
  27.     samples since µ-law and VIDC are defined as 8-bit formats. 12 bit
  28.     samples are not supported.
  29.  
  30.   - Little and Big endian describes how to interpret 16-bit samples (or
  31.     any number stored in more than one byte). Little endian means the least
  32.     significant byte is stored first and Big endian means the most
  33.     significant byte is stored first. Little endian is the usual format for
  34.     formats originating from Arm and Intel based compuuters (eg Arc, PC) and
  35.     big endian is the usual format for formats originating from Motorola
  36.     based machines (eg Mac, Amiga).
  37.  
  38.   - Signed linear samples are stored as 2's complement numbers (ie signed)
  39.     that are directly proportional to the instantaneous amplitude of the
  40.     sample (ie linear).
  41.  
  42.   - Unsigned linear samples similar except that the maximum amplitude is
  43.     added to all samples (ie 128 for 8-bit, 32768 for 16-bit) to make all
  44.     the numbers positive (ie unsigned). In practise only the sign bit has to
  45.     be changed to convert from signed to unsigned.
  46.  
  47.   - µ-law samples are logarithmic which gives them a better dynamic range
  48.     than linear samples. Linear samples usually need to be about 12 bits to
  49.     provide the same low-amplitude resolution as µ-law. This format is
  50.     common on Unix machines.
  51.     
  52.   - A-law samples are a form of compression. 8-bit A-law compresses a 13-bit
  53.     linear sample by taking the 4 most significant bits from the 12-bit
  54.     magnitude and shifting them by 0-7 bits as defined by a further 3 bits.
  55.     The eighth bit is the sign. This gives A-law a good dynamic range with
  56.     few bits because it is essentially logarithmic.
  57.  
  58.   - Arc VIDC is the internal format used by the sound system on the
  59.     Archimedes making it a logical way to store samples on the Arc. It's
  60.     very similar to µ-law.
  61.  
  62.  
  63. Major format summaries
  64. ----------------------
  65.  
  66. Unless otherwise noted the PlaySample module used by SoundCon can play
  67. samples that are any combination of:
  68.  
  69.   - 8 or 16 bit
  70.   - mono or stereo
  71.   - linear signed, linear unsigned, mu-law, A-law or Arc VIDC
  72.  
  73. with the exception that 16 bits samples which can only be linear since
  74. mu-law, A-law and Arc VIDC are not actually defined for anything other than
  75. 8-bit.
  76.  
  77. Playback lists use the following summaries:
  78.  
  79.   - mono/stereo 8        (8-bit linear signed or unsigned)
  80.   - mono/stereo 16       (16-bit linear signed or unsigned)
  81.   - mono/stereo 8 slin   (8-bit signed linear)
  82.   - mono/stereo 8 ulin   (8-bit unsigned linear)
  83.   - mono/stereo 16 slin  (16-bit signed linear)
  84.   - mono/stereo 16 ulin  (16-bit unsigned linear)
  85.   - mono/stereo mu-law   (8-bit mu-law)
  86.   - mono/stereo A-law    (8-bit A-law)
  87.   - mono/stereo VIDC     (8-bit Archimedes VIDC)
  88.  
  89. A summary like "mono/stereo 8/16" means all combinations are allowable, ie
  90. "mono 8, stereo 8, mono 16, stereo 16".
  91.  
  92.  
  93. The following major formats are supported by the current version of SoundCon.
  94.  
  95.   Audio IFF
  96.   Armadeus
  97.   ARMovie
  98.   Sun Audio
  99.   Audioworks
  100.   Datavox
  101.   IFF/8SVX
  102.   Psion S3a
  103.   Raw data
  104.   VOC (Creative Voice)
  105.   Voice module (write only)
  106.   RIFF WAVE
  107.  
  108.  
  109. Audio IFF
  110.  
  111.   Audio IFF (Interchange File Format) is a standard 'chunked' file format
  112.   which supports a wide range of sound sub-formats. This format originated
  113.   on Apple computers so multi-byte numbers are big endian.
  114.  
  115.   Channels: Any number of channels can be represented (in theory, up to
  116.   2^32). SoundCon can read up to 4 channels and write up to 2.
  117.  
  118.   Bits: Anywhere from 1-32 bits per sample can be represented. SoundCon can
  119.   read from 1-24 bits and can write 8 or 16 bits.
  120.  
  121.   Format: The format is always linear signed left justified to make it byte
  122.   aligned. eg for 4-bit samples, the 4 most significant bits of a byte are
  123.   used. For 12 bits sample, the 12 most significant of 2 bytes are used.
  124.   Samples are always byte aligned (ie they are not packed).
  125.  
  126.   Playback: Mono/stereo 8 slin/16 slin
  127.  
  128.  
  129. Armadeus
  130.  
  131.   Armadeus is a simple Archimedes format. Its only variable is the playback
  132.   frequency (stored as the sample period in microseconds in the first byte
  133.   of the file). The format is fixed as 8-bit linear signed (ie 2's
  134.   complement). The only way to identify these samples is by file type as no
  135.   charactersing information is stored in the file.
  136.  
  137.   Playback: Mono 8 (ie yes!)
  138.  
  139.  
  140. ARMovie
  141.  
  142.   ARMovie is the soundtrack part of Acorn Replay files.
  143.  
  144.   Channels: mono or stereo
  145.  
  146.   Format: linear signed or unsigned (8 or 16 bit) or 8-bit VIDC
  147.  
  148.   Playback: Mono/stereo 8/16/VIDC (but only if the data is continuous. Sound
  149.   is normally interleaved with video data so generally only sound-only
  150.   ARMovies can be played.)
  151.  
  152.  
  153. Sun Audio
  154.  
  155.   This format originated on Unix computers. 8khz mu-law is a very common
  156.   sub-format for this although it can support many (only a couple of which
  157.   are supported by SoundCon).
  158.  
  159.   Channels: Any number of channels can be represented (in theory, up to
  160.   2^32). SoundCon can read up to 4 channels and write up to 2.
  161.  
  162.   Bits: This depends on the format. 8, 16, 24 or 32 can be represented.
  163.  
  164.   Format: Sun Audio now supports a large number of formats. Basically there
  165.   is 8-bit, 8-bit A-law, compressed samples and various representations of
  166.   8, 16, 24 and 32-bit linear samples. SoundCon can read 8-bit mu-law, 8-bit
  167.   A-law and 8, 16, 24 and 32-bit linear samples with up to 4 channels. It can
  168.   write 8-bit mu-law, 8-bit A-law 8 and 16-bit linear samples with up to 2
  169.   channels.
  170.  
  171.   Playback: Mono/stereo 8 slin/16 slin/u-law/A-law
  172.   
  173.   
  174. Datavox
  175.  
  176.   This is an Acorn specific format supporting most standard formats. Stereo
  177.   and/or 16-bit samples have their bytes in different parts of file which
  178.   makes this format difficult, and hence slow, for SoundCon to handle
  179.   (SoundCon was designed for interleaved samples). Formats 1, 2 and 3 are
  180.   recognised but saving is always done in format 3.
  181.   
  182.   Channels: mono or stereo (format 3 only).
  183.   
  184.   Bits: 8 or 16 (format 3 only).
  185.   
  186.   Format: VIDC, mu-law, s-lin 8/16 and u-lin 8/16. The 16-bit formats are
  187.   only supported in format 3.
  188.   
  189.   Playback: Although SoundCon can play all of the supported formats, only the
  190.   high byte of 16-bit samples and the left channel of stereo samples is used.
  191.   This is because the bytes are not interleaved and the PlaySample module
  192.   needs them to be.
  193.     
  194.   
  195. Psion S3a
  196.  
  197.   This format is used on the Psion portable computers. It has a rigid format
  198.   and there are no variables whatsoever. It is fixed at mono 8-bit A-law at
  199.   8kHz.
  200.   
  201.   Channels: 1
  202.   Bits: 8
  203.   Format: A-law
  204.   Playback: mono A-law
  205.  
  206.  
  207. AudioWorks
  208.  
  209.   This is a versatile Archimedes format based on the Acorn Chunk File
  210.   Format.
  211.  
  212.   Channels: Up to 255 channels in theory. SoundCon can read up to 4 channels
  213.   and write up to 2. Note that for polyphonic samples samples are
  214.   interleaved in blocks of 8.
  215.  
  216.   Bits: 8, 12 or 16 bits for linear formats, 8-bits for the others.
  217.  
  218.   Format: Linear signed, Linear unsigned, mu-law, A-law and Archimedes VIDC.
  219.  
  220.   Playback: Mono/stereo 8/16/u-law/A-law/VIDC
  221.  
  222.  
  223. IFF/8SVX
  224.  
  225.   This is a cousin of Audio IFF (they both use the IFF chunk format) that
  226.   specifically holds 8-bit mono samples (usually instrument voices). It
  227.   supports section repeating and data compression; neither of which are
  228.   supported by SoundCon.
  229.  
  230.   Playback: Mono 8 slin (ie yes)
  231.  
  232.  
  233. VOC
  234.  
  235.   The Creative Voice format (VOC) is a PC sourced format similar to 8SVX. It
  236.   can represent silence blocks, repeat blocks and compression. SoundCon can
  237.   only handle trivial VOCs currently - mainly because I haven't been able to
  238.   find any reliable information on this format.
  239.  
  240.   Playback: Mono 8 ulin. If the sample is made up of continued blocks there
  241.   will be clicking in the playback (which SoundCon warns you of). This will
  242.   not be present when it is converted to another format.
  243.  
  244.  
  245. Voice module
  246.  
  247.   Voice modules are basically self-playing samples; they are stored in the
  248.   mono VIDC format. The module provided a single command; Splay_xxx where
  249.   xxx is the filename given when saved. Executing this command causes the
  250.   module to claim a sound channel, play the sound at the originally
  251.   sampled rate and release the channel when its finished. This is a
  252.   transient playback since it only attaches itself to the sound system
  253.   temporarily.
  254.  
  255.   There are three option sets provided by SoundCon:
  256.  
  257.   Transient/voice: A voice attaches itself to the system voice list when it
  258.   is loaded so that it can be subsequently assigned to a sound channel and
  259.   played. A transient voice does not declare itself as a voice and can only
  260.   be used by issuing a star command.
  261.  
  262.   Fixed/variable frequency: Variable frequency sounds are normal instrument
  263.   sounds that can have their pitch altered by the sound command. Fixed
  264.   frequency mode is useful for 'effect' samples where the idea is to
  265.   reproduce the original sound. In this case, the sample is played the
  266.   sampled frequency and cannot be altered at play time.
  267.  
  268.   Volume mode: There are four volume modes:
  269.   - Normal vol: The volume is controlled as normal by the channel volume in
  270.     the sound command and by the overall system volume.
  271.   - Sys vol: The channel volume in the sound command is ignored (maximum is
  272.     used) so only the overall system volume affects the volume.
  273.   - Channel vol: The overall system volume is ignored (works as if it was
  274.     maximised) and the volume is controlled solely by the sound command.
  275.   - Fixed vol: All volume settings are ignored. The volume used is that of
  276.     playback slider in SoundCon when you initiate the save.
  277.  
  278.   Playback: Since this is a write-only format, SoundCon itself cannot play
  279.   voice modules. They are self-playing.
  280.  
  281.  
  282. RIFF WAVE
  283.  
  284.   The WAVE format is one of the many supported chunks in the RIFF 'chunked'
  285.   file format which supports a wide range of sound sub-formats. This format
  286.   originated on PCs so multi-byte numbers are little endian.
  287.  
  288.   Channels: Usually one or two supported although up to 65535 could
  289.   theoretically be stored. SoundCon can read up to 4 channels and write up
  290.   to 2.
  291.  
  292.   Bits: Depends on the format (4, 8 or 16).
  293.  
  294.   Format: WAVE supports numerous formats many of which are difficult to find
  295.   information about. The ones supported by SoundCon are:
  296.     PCM: 8 bit linear unsigned or 16 bit signed, mono or stereo.
  297.     mu-law: 8-bit logarithmic format, mono or stereo.
  298.     A-law: 8-bit pseudo logarithmic format, mono or stereo.
  299.     MS ADPCM: 4-bit Microsoft ADPCM, mono or stereo.
  300.     DVI ADPCM: 4-bit Intel ADPCM, mono or stereo.
  301.  
  302.   Playback: mono/stereo 8/16/mu-law/A-law/MSADPCM/DVI ADPCM (ie all those
  303.   recognised)
  304.  
  305.  
  306.  
  307. ADPCM formats
  308. =============
  309.  
  310. ADPCM (Adaptive Delta Pulse Code Modulation) is a way of storing sound in a
  311. compressed format. It is not an algorithm per se but simply says that the
  312. sound samples are encoded in some way using the differences between samples
  313. (ie deltas). Pulse Code Modulation (PCM) is basically a fancy way of saying
  314. 'digitised sound'. There are many different ADPCM algorithms and SoundCon
  315. supports the only two I could find information on.
  316.  
  317. Sound is typically very difficult to compress and standard compression
  318. techniques like LZH will maybe save 25% if you're lucky. ADPCM algorithms
  319. are lossy (imperfect) compression techniques garanteed to give a highish
  320. compression ratio. Usually samples are stored as 4-bit encoded deltas (75%
  321. saving on 16-bit samples) and the quality is good, though not perfect;
  322. rather like JPEG picture compression.
  323.  
  324. Because ADPCM algorithms rely on local trends in the sound wave to predict
  325. what the next sample will be, they do not encode noisy sounds (having a
  326. random element) very well. They do well on things like large music files.
  327.